Conventionally, positioning of an object is carried out by a pattern-matching process using a template. In accordance with this pattern-matching process, a window is set in image data obtained by photographing the object, and the degree of coincidence or the degree of similarity between the image of the object within the window and a reference image that has been preliminarily registered is calculated. By carrying out these calculations as well as successively scanning the window within the image data, it is possible to find out the position at which the highest degree of coincidence or the highest degree of similarity is obtained, and the positioning is carried out based upon this position.
Correlation coefficients are used as one of the indicators for the degree of similarity. In this method, for example, a reference image with N.times.N pixels, preliminarily registered, is superposed on a search area (M-N+1).times.(M-N+1) within the target image with M.times.M pixels that is larger than the reference image. Further, it is and shifted so as to find the position of the upper left corner of the reference image that makes the result of the following equation (1) maximum. ##EQU1##
In the above equation (1), (a, b) indicates the upper right corner of the reference image within the target image, I.sub.(a, b) (m, n) indicates a partial image within the target image, and T(m, n) indicates the reference image.
However, since the above-mentioned equation (1) requires a large amount of calculations, the application of the equation results in a problem of requirement of large-scale hardware upon carrying out operations at high speeds. In general, in order to solve this problem, an approximate positioning, that is, a rough search, is carried out on an image with a reduced resolution so as to find out candidate points. Further, a more accurate positioning is carried out in the proximity of these candidate points.
Here, in one of the known positioning devices (for example, Japanese Laid-Open Patent Publication No. 157577/1992 (Tokukaihei 4-157577)), a gradation conversion, which converts the density bit numbers of the original images of the reference image and a target image into fewer density bit numbers, is carried out so as to reduce the amount of calculations required for the positioning. The the degree of coincidence between the edge of the reference image and the edge of the target image is calculated by carrying out noise elimination and edge extraction.
In the above-mentioned positioning device, as disclosed in Japanese Laid-Open Patent Publication No. 157577/1992 (Tokukaihei 4-157577), however, upon carrying out the gradation conversion between the original images of the reference image and the target image so as to reduce the amount of calculations required for the positioning between the reference image and the target image, the gradation of the original image is merely compressed by eliminating lower bits by carrying out dividing operations, etc., regardless of the contrast of the image.
However, in the case of poor contrast in the original image, such as in the case of target images that are too dark or too bright, the image obtained after the gradation conversion tends to become an image with extremely few gradations. In such a case, the further the density bit number after the gradation conversion is reduced, the worse the operation accuracy in the degree of similarity on correlation coefficients, etc., Further, since effective bits related to contrast tend to be buried and become inconspicuous, it is difficult to carry out the rough search effectively.